//
//  FriendIDNextViewController.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/4/5.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "FriendIDNextViewController.h"

@interface FriendIDNextViewController ()

@property (nonatomic, strong) UIImageView *friendImageV; // 好友头像
@property (nonatomic, strong) UILabel *friendName; // 好友名字
@property (nonatomic, strong) UILabel *remarkLabel; // 备注
@property (nonatomic, strong) UILabel *groupLabel; // 分组

@end

@implementation FriendIDNextViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    // navi的修改
    [self changeNavigation];
    //  布局视图
    [self addMySubview];
}

// navi的修改
- (void)changeNavigation
{
    [self.navigationController.navigationBar setTranslucent:NO];
    self.navigationItem.title = @"好友管理";
    UIImageView *leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    leftImageView.image = [UIImage imageNamed:@"houtui"];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftImageView];
    UITapGestureRecognizer *leftTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lastPage:)];
    [leftImageView addGestureRecognizer:leftTapGes];
    
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithTitle:@"发送" style:UIBarButtonItemStylePlain target:self action:@selector(send:)];
    rightItem.tintColor = [UIColor whiteColor];
    self.navigationItem.rightBarButtonItem = rightItem;
    
}

#pragma mark - 返回上一页面
- (void)lastPage:(UITapGestureRecognizer *)tapGes
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - 发送
- (void)send:(UIBarButtonItem *)rightItem
{
    NSLog(@"发送");
    [self addAlertView];
}

// 提示框
- (void)addAlertView
{
    // 浅色背景
    UIView *cyanBackView = [[UIView alloc] initWithFrame:CGRectMake((kScreenWidth - 140 * kAdjustParamater) / 2, 300 * kAdjustParamater, 140 * kAdjustParamater, 130 * kAdjustParamater)];
    cyanBackView.backgroundColor = [UIColor colorWithRed:84 / 255.0 green:199 / 255.0 blue:222 / 255.0 alpha:1];
    [self.view addSubview:cyanBackView];
    
    // 白色背景
    UIView *whiteBackView = [[UIView alloc] initWithFrame:CGRectMake(15 / 2 * kAdjustParamater, 15 / 2 * kAdjustParamater, 125 * kAdjustParamater, 115 * kAdjustParamater)];
    whiteBackView.backgroundColor = [UIColor whiteColor];
    [cyanBackView addSubview:whiteBackView];
    
    // 壹基因图片
    UIImageView *yiJinYinLogo = [[UIImageView alloc] initWithFrame:CGRectMake(8 * kAdjustParamater, 0, 120 * kAdjustParamater, 45 * kAdjustParamater)];
    yiJinYinLogo.image = [UIImage imageNamed:@"yijiyinlogo"];
    [whiteBackView addSubview:yiJinYinLogo];
    
    // 好友申请
    UILabel *friendApplyLabel = [[UILabel alloc] initWithFrame:CGRectMake(45 / 2 * kAdjustParamater, yiJinYinLogo.bottom + 7 * kAdjustParamater, 80 * kAdjustParamater, 30 * kAdjustParamater)];
    friendApplyLabel.backgroundColor = [UIColor redColor];
    friendApplyLabel.text = @"好友申请已经发出请耐心等待哦~";
    friendApplyLabel.numberOfLines = 0;
    friendApplyLabel.textColor = [UIColor colorWithRed:84 / 255.0 green:199 / 255.0 blue:222 / 255.0 alpha:1];
    friendApplyLabel.font = [UIFont systemFontOfSize:k15Big];
    [whiteBackView addSubview:friendApplyLabel];
    
    // 对号
    UIButton *duiHaoButton = [UIButton buttonWithType:UIButtonTypeCustom];
    duiHaoButton.frame = CGRectMake(103 / 2 * kAdjustParamater, friendApplyLabel.bottom + 10 * kAdjustParamater, 22 * kAdjustParamater, 22 * kAdjustParamater);
    [duiHaoButton setImage:[UIImage imageNamed:@"发送消息弹窗duihao"] forState:UIControlStateNormal];
    [duiHaoButton addTarget:self action:@selector(duiHao:) forControlEvents:UIControlEventTouchUpInside];
    [whiteBackView addSubview:duiHaoButton];
    
}

- (void)duiHao:(UIButton *)button
{
    
}

#pragma mark - 布局视图
- (void)addMySubview
{
    self.friendImageV = [[UIImageView alloc] initWithFrame:CGRectMake(10 * kAdjustParamater, 20 * kAdjustParamater, 50 * kAdjustParamater, 50 * kAdjustParamater)];
    self.friendImageV.backgroundColor = [[UIColor yellowColor] colorWithAlphaComponent:0.5];
    self.friendImageV.layer.cornerRadius = 25 * kAdjustParamater;
    [self.view addSubview:_friendImageV];
    
    self.friendName = [[UILabel alloc] initWithFrame:CGRectMake(self.friendImageV.right + 10 * kAdjustParamater, self.friendImageV.top + 15 * kAdjustParamater, 150 * kAdjustParamater, 20 * kAdjustParamater)];
    //   self.friendName.backgroundColor = [UIColor redColor];
    self.friendName.text = @"张国文张国文";
    self.friendName.textAlignment = NSTextAlignmentLeft;
    self.friendName.font = [UIFont systemFontOfSize:k15Big];
    self.friendName.textColor = [UIColor blackColor];
    [self.view addSubview:_friendName];
    
    // 备注上方灰色条
    UILabel *grayLineOnRemarkTop = [[UILabel alloc] initWithFrame:CGRectMake(0, self.friendImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnRemarkTop.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.03];
    [self.view addSubview:grayLineOnRemarkTop];
    
    // 备注
    UILabel *beiZhuLabel = [[UILabel alloc] initWithFrame:CGRectMake(25 * kAdjustParamater, grayLineOnRemarkTop.bottom + 12 * kAdjustParamater, 30 * kAdjustParamater, 20 * kAdjustParamater)];
    beiZhuLabel.text = @"备注";
    beiZhuLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
 //   beiZhuLabel.backgroundColor = [UIColor redColor];
    beiZhuLabel.font = [UIFont systemFontOfSize:k15Big];
    [self.view addSubview:beiZhuLabel];
    
    self.remarkLabel = [[UILabel alloc] initWithFrame:CGRectMake(beiZhuLabel.right + 35 * kAdjustParamater, beiZhuLabel.top, 200 * kAdjustParamater, 20 * kAdjustParamater)];
   // self.remarkLabel.backgroundColor = [UIColor redColor];
    self.remarkLabel.textAlignment = NSTextAlignmentLeft;
    self.remarkLabel.text = @"我是张国文你是谁";
    self.remarkLabel.textColor = [UIColor blackColor];
    self.remarkLabel.font = [UIFont systemFontOfSize:k15Big];
    [self.view addSubview:_remarkLabel];
    
    // 灰色条在备注下方
    UILabel *grayLineOnBeiZhuBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, beiZhuLabel.bottom + 13 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnBeiZhuBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.03];
    [self.view addSubview:grayLineOnBeiZhuBottom];
    
    // 分组后面的白色背景
    UIView *whiteViewOnFenZhuBack = [[UIView alloc] initWithFrame:CGRectMake(0, grayLineOnBeiZhuBottom.bottom, kScreenWidth, 45 * kAdjustParamater)];
    whiteViewOnFenZhuBack.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:whiteViewOnFenZhuBack];
    
    // 添加手势
    UITapGestureRecognizer *tapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectGroup:)];
    [whiteViewOnFenZhuBack addGestureRecognizer:tapGes];
    
    // 分组
    UILabel *fenZuLabel = [[UILabel alloc] initWithFrame:CGRectMake(25 * kAdjustParamater, 12 * kAdjustParamater, 30 * kAdjustParamater, 20 * kAdjustParamater)];
  //  fenZuLabel.backgroundColor = [UIColor redColor];
    fenZuLabel.text = @"分组";
    fenZuLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
    fenZuLabel.font = [UIFont systemFontOfSize:k15Big];
    [whiteViewOnFenZhuBack addSubview:fenZuLabel];
    
    self.groupLabel = [[UILabel alloc] initWithFrame:CGRectMake(fenZuLabel.right + 35 * kAdjustParamater, fenZuLabel.top, 200 * kAdjustParamater, 20 * kAdjustParamater)];
  //  self.groupLabel.backgroundColor = [UIColor redColor];
    self.groupLabel.text = @"我的好友";
    self.groupLabel.textColor = [UIColor blackColor];
    self.groupLabel.textAlignment = NSTextAlignmentLeft;
    self.groupLabel.font = [UIFont systemFontOfSize:k15Big];
    [whiteViewOnFenZhuBack addSubview:_groupLabel];
    
    // 灰色箭头
    UIImageView *grayJianTouV = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 30 * kAdjustParamater, fenZuLabel.top, 17 * kAdjustParamater, 17 * kAdjustParamater)];
    grayJianTouV.image = [UIImage imageNamed:@"grayJianTou"];
    [whiteViewOnFenZhuBack addSubview:grayJianTouV];
    
    // 下方灰色
    UILabel *grayLineOnScreenBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, whiteViewOnFenZhuBack.bottom, kScreenWidth, 500 * kAdjustParamater)];
    grayLineOnScreenBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.03];
    [self.view addSubview:grayLineOnScreenBottom];
    
}


#pragma mark - 选组
- (void)selectGroup:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"选组");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
